{extend name='main'}

{block name='content'}

<style>

    .store-total-container {
        font-size: 14px;
        margin-bottom: 20px;
        letter-spacing: 1px;
    }

    .store-total-container .store-total-icon {
        top: 45%;
        right: 8%;
        font-size: 65px;
        position: absolute;
        color: rgba(255, 255, 255, 0.4);
    }

    .store-total-container .store-total-item {
        color: #fff;
        line-height: 4em;
        padding: 15px 25px;
        position: relative;
    }

    .store-total-container .store-total-item > div:nth-child(2) {
        font-size: 46px;
        line-height: 46px;
    }

</style>

<div class="think-box-shadow store-total-container notselect">
    <div class="margin-bottom-15">快捷操作</div>
    <div class="layui-row layui-col-space15">
        <div class="layui-col-sm6 layui-col-md3">
            <div class="store-total-item nowrap" style="background:linear-gradient(-125deg,#57bdbf,#2f9de2)">
                <div>日常收文</div>
                <div><a data-target-tips="收文列表" data-open="/document/doc/daiban.html" data-menu-node="m-62-63-64">收文</a></div>
                <div>从外部收文后转发</div>
            </div>
            <i class="store-total-icon layui-icon layui-icon-form"></i>
        </div>

        <div class="layui-col-sm6 layui-col-md3">
            <div class="store-total-item nowrap" style="background:linear-gradient(-125deg,#ff7d7d,#fb2c95)">
                <div>发文</div>
                <div><a data-target-tips="发文列表" data-open="/document/docout/index.html" data-menu-node="m-66-67-68">发文</a></div>
                <div>对外发文</div>
            </div>
            <i class="store-total-icon layui-icon layui-icon-note"></i>
        </div>
        <div class="layui-col-sm6 layui-col-md3">
            <div class="store-total-item nowrap" style="background:linear-gradient(-113deg,#c543d8,#925cc3)">
                <div>网站新闻</div>
                <div><a data-target-tips="网站新闻" data-open="/document/news/index.html" data-menu-node="m-73-74-75">新闻</a></div>
                <div>单位网站发文审批</div>
            </div>
            <i class="store-total-icon layui-icon layui-icon-read"></i>
        </div>
        <div class="layui-col-sm6 layui-col-md3">
            <div class="store-total-item nowrap" style="background:linear-gradient(-141deg,#ecca1b,#f39526)">
                <div>内部件</div>
                <div><a href="/admin.html#/document/docin/index.html">请示</a></div>
                <div>请示文件内部流转</div>
            </div>
            <i class="store-total-icon  fa fa-retweet "></i>
        </div>
    </div>
</div>

<!--
<div class="think-box-shadow store-total-container">
    <div class="margin-bottom-15">数据统计</div>
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md6 margin-bottom-15">
            <div class="layui-row">
                <div class="layui-col-xs3 text-center">
                    <i class="layui-icon color-blue" style="font-size:60px;line-height:72px">&#xe65e;</i>
                </div>
                <div class="layui-col-xs4">
                    <div class="font-s14">收文数量</div>
                    <div class="font-s16">1351</div>
                    <div class="font-s12 color-desc"></div>
                </div>
				
				
				
                <div class="layui-col-xs5">
                    <div class="font-s14">发文数量</div>
                    <div class="font-s16">106</div>
                    <div class="font-s12 color-desc"></div>
                </div>
            </div>
        </div>
		
        <div class="layui-col-md6 margin-bottom-15">
            <div class="layui-row">
                <div class="layui-col-xs3 text-center">
                    <i class="layui-icon color-blue" style="font-size:60px;line-height:72px">&#xe663;</i>
                </div>
                <div class="layui-col-xs4">
                    <div class="font-s14">新增用户数</div>
                    <div class="font-s16">327</div>
                    <div class="font-s12 color-desc">昨日：238</div>
                </div>
                <div class="layui-col-xs5">
                    <div class="font-s14">下单用户数</div>
                    <div class="font-s16">69</div>
                    <div class="font-s12 color-desc">昨日：34</div>
                </div>
            </div>
        </div>
		
    </div>
</div>

-->

<div class="layui-row layui-col-space15">


    <div class="layui-col-md6">
        <div class="think-box-shadow">
            <table class="layui-table" lay-skin="line" lay-even>
                <caption class="text-left margin-bottom-15 font-s14">我未审批的文件</caption>

				


                <tbody>
                <tr>
					<td width="8%">序号</td>
					<td width="20%">类型</td>
                    <td>文件标题</td>
                    <td width="15%">文件日期</td>
                </tr>
				</tbody>
				<tbody id="logList"></tbody>
				
				</tbody>
				
				
				<!--
				{foreach $doc2 as $key=>$vo}
                <tr>
					<td>{$vo.id}</td>
					<td>收文</td>
                    <td><a data-dbclick data-open="/document/doc/edit.html?id={$vo.id}&spm=m-62-63-64">{$vo.title|default=''}</a></td>
                    <td>{$vo.docdate|format_datetime='Y-m-d'}</td>
                </tr>
				{/foreach}
				-->
				
				{foreach $doc1 as $key=>$vo}
                <tr>
					<td>{$vo.id}</td>
					<td width="10%">
					{eq name='vo.doctypes' value='docout'}<span class="color-red">对外发文(有文号)</span>{/eq}
					{eq name='vo.doctypes' value='docnone'}<span class="color-blue">对外发文(无文号)</span>{/eq}
					{eq name='vo.doctypes' value='stamp'}<span class="color-green">印章使用</span>{/eq}
					{eq name='vo.doctypes' value='news'}<span class="color-orange">网站新闻</span>{/eq}
                    {eq name='vo.doctypes' value='docin'}<span class="color-orange">内部请示件</span>{/eq}
					</td>
                    <td><a data-dbclick data-open="/document/{$vo.doctypes}/edit.html?id={$vo.id}&spm={$vo.spm}">{$vo.title|default=''}</a></td>
                    <td>{$vo.docdate|format_datetime='m-d'}</td>
                </tr>
				{/foreach}


				{foreach $doc3 as $key=>$vo}
                <tr>
					<td>{$vo.id}</td>
					<td width="10%">
					{eq name='vo.doctypes' value='holiday'}<span class="color-red">请休假</span>{/eq}
					</td>
                    <td><a data-dbclick data-open="/person/holiday/edit_holiday.html?id={$vo.id}&spm={$vo.spm}">{$vo.title|default=''}</a></td>
                    <td>{$vo.addtime|format_datetime='m-d'}</td>
                </tr>
				{/foreach}


				
				<tfoot>
					<tr>
						<td colspan="4">
							<div class="pull-left" style="margin-top: 8px;">
								<span id="summary"></span>
							</div>
							<div class="pull-right">
								<form class="form-inline">
									<button id="firstPage" type="button" class="layui-btn layui-btn-xs layui-btn-primary">首页</button>&nbsp;
									<button id="previousPage" type="button" class="layui-btn layui-btn-xs layui-btn-primary">上一页</button>&nbsp;
									<button id="nextPage" type="button" class="layui-btn layui-btn-xs layui-btn-primary">下一页</button>&nbsp;
									<button id="lastPage" type="button" class="layui-btn layui-btn-xs layui-btn-primary">尾页</button>&nbsp;
									<span>跳转到</span>&nbsp;
									<input type="text" class="form-control" name="page_num" style="width:30px;"/>&nbsp;
									<span>页</span>&nbsp;
									<button id="jump" type="button" class="layui-btn layui-btn-xs layui-btn-primary">跳转</button>
								</form>
							</div>
						</td>
					</tr>
				</tfoot>

				


                
            </table>
        </div>
    </div>

    <div class="layui-col-md6">
        <div class="think-box-shadow">
            <table class="layui-table" lay-skin="line" lay-even>
                <caption class="text-left margin-bottom-15 font-s14">单位公告</caption>

				
                <tr>
					<td width="8%">序号</td>
					<td>公告标题</td>
                    <td>发布部门</td>
                    <td >日期</td>
                </tr>
				
                <tbody>
				{foreach $news as $key=>$vo}
                <tr>
                    <td>{$vo.id}</td>
                    <td><a href="/admin.html#/document/notice/edit.html?id={$vo.id}&spm=m-77-78-80">{$vo.title}</a></td>
					<td>{$vo.docdept}</td>
					<td>{$vo.create_at|format_datetime='m-d'}</td>
                </tr>
				{/foreach}

                </tbody>
            </table>
        </div>
    </div>
	
	

	
	
	
</div>
{/block}
{block name='script'}

<script type="text/javascript">
	$(document).ready(function(){
		var page = 1;
		var pageSize = 5;
		var pages = 0;
		//获取日志信息
		function loadData(page,pageSize){
			//每次重新从API数据接口获取数据都要先清除原先表格 <tr>的内容
			$(".detail").remove();
			$.ajax({
				type:"post",
				url:"/admin/index/getDocList.html",
				async:true,
				dataType:"json",
				data:{
					"token":window.sessionStorage.tokenbody,
					"page":page,
					"pageSize":pageSize
				},
				success:function(data){
					//console.log(data)
					if(data.errcode == 0){
						
						var getlogList = data.body.rows;
						//共多少条
						var totalCount = data.body.total;
						//共多少页
						pages = data.body.pageCount;
						
						for(var i=0;i<getlogList.length;i++){
							$("#logList").append('<tr class="detail"><td>'+getlogList[i].id+'</td><td>收文</td><td><a data-open="/document/doc/edit.html?id='+getlogList[i].id+'&spm=m-62-63-64">'+getlogList[i].title+'</a></td><td>'+getlogList[i].docdate+'</td></tr>');
						}
						//<td><button type="button" οnclick="seedetial('+getlogList[i].id+')" class="btn btn-info btn-sm">查看详情</button></td>
						
						displayFooter(totalCount, page, pages);
					}
					if(data.errcode != 0){
						layer.msg(data.errmsg);
					}
				},
				error:function(){
					layer.msg("系统繁忙，请联系管理员");
				}
			});
		}
		loadData(page,pageSize);
		
		//展示foot左面信息
		function displayFooter(totalCount, page, pages){
			var newText = '共'+totalCount+'条，'+'第'+page+'页，'+'共'+pages+'页';
			$("#summary").text(newText);
		}
		
		//跳转页码
		$("input[name='page_num']").keydown(function(e){
			if(e.keyCode == 13){
				$("#jump").click();
			}
		});
		$("#jump").click(function(){
			var goPage = $("input[name='page_num']").val();
			if(goPage >= 1 && goPage <= pages && goPage != page){
				page = goPage;
				loadData(page,pageSize);
			}else{
				return false;
			}
		});
		//首页
		$("#firstPage").click(function(){
			page = 1;
			loadData(page, pageSize);
		});
		//最后一页
		$("#lastPage").click(function(){
			page = pages;
			//console.log(page)
    		loadData(page, pageSize);
		});
		//上一页
		$("#previousPage").click(function(){
			if(page == 1){
        		return false;
    		}else{
        		page--;
        		loadData(page, pageSize);
    		}
		});
		//下一页
		$("#nextPage").click(function(){
			if(page == pages){
        		return false;
    		}else{
        		page++;
        		loadData(page, pageSize);
    		}
		});
	});
 
 

 
 
 
 
 
 
 
 
 
 
 
 
</script>
{/block}
